package com.qc31.comlib.adapter

import android.widget.TextView
import com.chad.library.adapter.base.BaseQuickAdapter
import com.chad.library.adapter.base.viewholder.BaseViewHolder
import com.qc31.comlib.R
import com.qc31.comlib.entity.ChooseTime

/** @Author Jasper @Time 2020/8/10 @Desc 快捷时间适配器 */
class ChooseTimeAdapter :
    BaseQuickAdapter<ChooseTime, BaseViewHolder>(R.layout.item_fast_time) {
    var index: Int = -1
    override fun convert(holder: BaseViewHolder, item: ChooseTime) {

        val view = holder.getView<TextView>(R.id.item_choose_time)
        view.setText(item.timeNameId)
        view.isSelected = index == holder.layoutPosition

    }
}